﻿using blackhouse.WebNemo.Business.Groups;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.WebNemo.Business.Extensionable {
    public abstract class GroupExtension {

        #region Fields

        protected IGroup group;

        #endregion

        #region Constructors

        public GroupExtension(IGroup group) {
            this.group = group;
        }

        #endregion

        #region Methods

        public abstract bool ShouldUseThisColumnInEditor(GroupColumn column);

        #endregion

        #region NULL

        private static GroupExtension nullExtension = new NULLGroupExtension();

        public static GroupExtension NULL {
            get { return nullExtension; }
        }

        private class NULLGroupExtension : GroupExtension {

            #region Constructor

            public NULLGroupExtension()
                : base(null) { }

            #endregion

            #region Methods

            public override bool ShouldUseThisColumnInEditor(GroupColumn column) {
                return !column.HideForEdition;
            }

            #endregion

        }

        #endregion
        
    }

}
